------------------------------------------------------------------------------------------------------
       log:  C:\DATA\electoral.log
  log type:  text
 opened on:  18 May 2005, 09:53:50

.  #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      electoral_pres.do                               *;
. *       Date:           18/5/05                                         *;
. *       Author:         MRG                                             *;
. *       Purpose:        Do-file to replicate results for AJPS version   *;
. *                       of presidential candidates paper where          *;
. *                       dependent variable is electoral parties.        *;
. *                       Results for Table 1. Also provides second half  *;
. *                       of the Afghanistan example.                     *;
. *       Input File:     legislative_newp.dta                            *;
. *       Output File:    electoral.log                                   *;
. *       Data Output:    None                                            *;
. *       Previous file:                                                  *;
. *       Machine:        Home                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

. set matsize 150;

. *     ****************************************************************  *;
. *       First, do Amorim Neto and Cox in the 1980s                      *;
. *     ****************************************************************  *;
. use c:\ajps\coxappend.dta;

. regress enpv proximit enpres proxpres eneth lnml lmleneth if drop==0, robust;

Regression with robust standard errors                 Number of obs =      51
                                                       F(  6,    44) =   33.77
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.6821
                                                       Root MSE      =  1.0654

------------------------------------------------------------------------------
             |               Robust
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    proximit |  -5.870379    1.30652    -4.49   0.000    -8.503496   -3.237262
      enpres |   .2064884   .2675578     0.77   0.444     -.332739    .7457157
    proxpres |   1.760122   .7465159     2.36   0.023     .2556183    3.264626
       eneth |  -.0849393   .2043377    -0.42   0.680    -.4967549    .3268763
        lnml |  -.3653744   .3538143    -1.03   0.307     -1.07844    .3476914
    lmleneth |   .6067504   .2697689     2.25   0.030     .0630669    1.150434
       _cons |   2.756443   .4063037     6.78   0.000     1.937592    3.575295
------------------------------------------------------------------------------

. clear;

. use c:\ajps\legislative_newp.dta;

. *     ****************************************************************  *;
. *                           Summary Statistics                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       867     100.083    39.39866          3        199
        year |       867    1978.435    16.12735       1946       2000
 institution |       867    1.720877    .8967816          1          3
     legelec |       867           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       867    .2226067    .4162364          0          1
      regime |       867    .0207612    .1426664          0          1
  regime_leg |       867           0           0          0          0
    eighties |       867    .0784314    .2690044          0          1
    nineties |       867    .1314879    .3381282          0          1
-------------+--------------------------------------------------------
         old |       867    .8662053    .3406281          0          1
      avemag |       843     11.2979    27.15588          1        150
   districts |       844    92.96682    141.6076          1        659
        eneg |       708    1.941652    1.227505   1.004012   14.22434
        enep |       791    3.878951    1.857447          1      14.89
-------------+--------------------------------------------------------
 enep_others |       788    3.154099    7.559339          0       69.3
       enep1 |       788    4.273211    3.811859          1      57.56
        enpp |       826    3.573923    3.853006          1      52.42
 enpp_others |       815    1.599509    6.055805          0         86
       enpp1 |       814    3.934066    7.452793          1     178.65
-------------+--------------------------------------------------------
      enpres |       858    1.186659    1.595493          0       6.57
      medmag |       702    12.72009    29.69172          1        150
      newdem |       867    .1534025    .3605831          0          1
  proximity1 |       867    .2918454    .4175579          0          1
  proximity2 |       867    .2214533    .4154646          0          1
-------------+--------------------------------------------------------
       seats |       860     201.943    163.7675         10        672
  upperseats |       817    14.89229    45.95744          0        344
   uppertier |       817    5.632791    12.65088          0      77.95
twoelections |       867    .0207612    .1426664          0          1
twoelectio~1 |       867    .0103806    .1014136          0          1
-------------+--------------------------------------------------------
pres_plura~y |       867    .0968858     .295973          0          1
 pres_runoff |       867    .2064591    .4049974          0          1
pres_major~y |       867    .0588235    .2354299          0          1
pres_qualm~y |       867    .0403691    .1969369          0          1
    pres_stv |       867    .0034602    .0587556          0          1
-------------+--------------------------------------------------------
pres_college |       867    .0230681    .1502063          0          1

. *     ****************************************************************  *;
. *       Note that observations on fractionalization do not equal the    *;
. *       number of observations on eneg. This is because Papua New       *;
. *       Guinea is coded as missing for eneg since there is perfect      *;
. *       fractionalization.  This is based on Fearon's dataset.          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                    Relabel and Define Variables                       *;
. *     ****************************************************************  *;
. label var country  "countryname";

. label var newdem "first election as new democracy";

. label var countrynumber "countrynumber";

. label var year "year";

. label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";

. label var regime_leg "regime type at time of legislative election 0 = democracy 1=dictatorship";

. label var legelec "legislative election";

. label var preselec "presidential election";

. label var eighties "election in 1980s closest to 1985";

. label var old "elections in countries that did not transition to democracy in 1990s";

. label var nineties "elections in 1990s closest to 1995";

. label var proximity1 "proximity - continuous";

. label var proximity2 "proximity - dichotomous";

. label var enpp "parliamentary parties - uncorrected";

. label var enpp1 "parliamentary parties - corrected";

. label var enep "electoral parties - uncorrected";

. label var enep1 "electoral parties - corrected";

. label var enpres "effective number of presidential candidates";

. label var seats "assembly size";

. label var districts "number of electoral districts";

. label var avemag "average district magnitude";

. label var medmag "median district magnitude";

. label var upperseats "number of uppertier seats";

. label var uppertier "percentage of uppertier seats";

. label var eneg "effective number of ethnic groups  fearon";

. describe;

Contains data from c:\ajps\legislative_newp.dta
  obs:           867                          
 vars:            36                          24 May 2004 14:36
 size:        96,237 (99.1% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str31  %31s                   countryname
countrynumber   int    %8.0g                  countrynumber
year            int    %8.0g                  year
institution     byte   %8.0g                  
legelec         byte   %8.0g                  legislative election
preselec        byte   %8.0g                  presidential election
regime          byte   %8.0g                  regime as of 31 December of
                                                given year 0=democracy
                                                1=dictatorship
regime_leg      byte   %8.0g                  regime type at time of
                                                legislative election 0 =
                                                democracy 1=dictatorship
eighties        byte   %8.0g                  election in 1980s closest to
                                                1985
nineties        byte   %8.0g                  elections in 1990s closest to
                                                1995
old             byte   %8.0g                  elections in countries that did
                                                not transition to democracy in
                                                1990s
avemag          float  %9.0g                  average district magnitude
districts       int    %8.0g                  number of electoral districts
eneg            float  %9.0g                  effective number of ethnic
                                                groups  fearon
enep            float  %9.0g                  electoral parties - uncorrected
enep_others     float  %9.0g                  
enep1           float  %9.0g                  electoral parties - corrected
enpp            float  %9.0g                  parliamentary parties -
                                                uncorrected
enpp_others     float  %9.0g                  
enpp1           float  %9.0g                  parliamentary parties -
                                                corrected
enpres          float  %9.0g                  effective number of
                                                presidential candidates
medmag          float  %9.0g                  median district magnitude
newdem          byte   %8.0g                  first election as new democracy
proximity1      float  %9.0g                  proximity - continuous
proximity2      byte   %8.0g                  proximity - dichotomous
seats           int    %8.0g                  assembly size
upperseats      int    %8.0g                  number of uppertier seats
uppertier       float  %9.0g                  percentage of uppertier seats
twoelections    byte   %8.0g                  
twoelections1   byte   %8.0g                  
pres_plurality  byte   %8.0g                  
pres_runoff     byte   %8.0g                  
pres_majority   byte   %8.0g                  
pres_qualmajo~y byte   %8.0g                  
pres_stv        byte   %8.0g                  
pres_college    byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  

. *     ****************************************************************  *;
. *       Would like to drop countries that have no recognizable parties  *;
. *       since I am interested in determining the number of parties.     *;
. *       Drop Kiribati, Marshall Islands, Micronesia, Nauru, Palau,      *;
. *       Lebanon (at least no votes by party), Kyrgzstan.                *;
. *       Since I am interested in competitive elections I drop the       *;
. *       elections that occurred in Colombia between 1958 and 1970 due   *;
. *       to a constitutional agreement to share power between the        *;
. *       conservative and liberal parties.                               *;
. *       Also drop the Congolese elections of 1963.  Although there were *;
. *       multiple parties permitted, all candidates ran on a single list.*;
. *       Thus, there was no actual competition in this election.         *;
. *     ****************************************************************  *;
. drop if countrynumber==163;
(6 observations deleted)

. drop if countrynumber==165;
(2 observations deleted)

. drop if countrynumber==197;
(3 observations deleted)

. drop if countrynumber==189;
(5 observations deleted)

. drop if countrynumber==146;
(12 observations deleted)

. drop if countrynumber==198;
(2 observations deleted)

. drop if countrynumber==167;
(8 observations deleted)

. drop if countrynumber==70 & year==1958;
(1 observation deleted)

. drop if countrynumber==70 & year==1960;
(1 observation deleted)

. drop if countrynumber==70 & year==1962;
(1 observation deleted)

. drop if countrynumber==70 & year==1964;
(1 observation deleted)

. drop if countrynumber==70 & year==1966;
(1 observation deleted)

. drop if countrynumber==70 & year==1968;
(1 observation deleted)

. drop if countrynumber==70 & year==1970;
(1 observation deleted)

. drop if countrynumber==12 & year==1963;
(1 observation deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       821     97.3715    37.35025          3        199
        year |       821     1978.35    16.15197       1946       2000
 institution |       821    1.719854    .8927666          1          3
     legelec |       821           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       821    .2180268    .4131574          0          1
      regime |       821    .0207065    .1424866          0          1
  regime_leg |       821           0           0          0          0
    eighties |       821    .0803898    .2720614          0          1
    nineties |       821    .1315469    .3382035          0          1
-------------+--------------------------------------------------------
         old |       821    .8733252    .3328111          0          1
      avemag |       804    11.72699    27.73206          1        150
   districts |       805    96.60373    143.9838          1        659
        eneg |       690    1.889245    1.181049   1.004012   14.22434
        enep |       782    3.878018    1.860428       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       779    3.171412    7.596386          0       69.3
       enep1 |       779    4.276418    3.829688       1.23      57.56
        enpp |       808     3.23625    1.470687          1      10.87
 enpp_others |       797    1.440527    4.762796          0       54.1
       enpp1 |       796    3.322802    1.756047          1      20.94
-------------+--------------------------------------------------------
      enpres |       815     1.21214    1.616311          0       6.57
      medmag |       664    13.30422    30.42178          1        150
      newdem |       821    .1534714     .360661          0          1
  proximity1 |       821    .2911449    .4150291          0          1
  proximity2 |       821    .2168088    .4123225          0          1
-------------+--------------------------------------------------------
       seats |       814    210.0037    164.1061         11        672
  upperseats |       778    15.61954    46.97577          0        344
   uppertier |       778    5.883021    12.88335          0      77.95
twoelections |       821    .0219245    .1465263          0          1
twoelectio~1 |       821    .0109622    .1041887          0          1
-------------+--------------------------------------------------------
pres_plura~y |       821     .090134    .2865482          0          1
 pres_runoff |       821    .2131547    .4097857          0          1
pres_major~y |       821    .0572473    .2324561          0          1
pres_qualm~y |       821    .0426309    .2021468          0          1
    pres_stv |       821    .0036541    .0603752          0          1
-------------+--------------------------------------------------------
pres_college |       821    .0243605    .1542598          0          1

. *     ****************************************************************  *;
. *       Does it matter if I use avemag instead of medmag?               *;
. *     ****************************************************************  *;
. correlate avemag medmag;
(obs=664)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. correlate avemag medmag if avemag~=1;
(obs=373)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. *     ****************************************************************  *;
. *       Correlation is extremely high in both cases i.e. greater than   *;
. *       99%.                                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Generate interaction variables ready for regressions.           *;
. *     ****************************************************************  *;
. generate logmag=ln(avemag);
(17 missing values generated)

. generate uppertier_eneg = uppertier*eneg;
(173 missing values generated)

. generate logmag_eneg = logmag*eneg;
(148 missing values generated)

. generate proximity1_enpres = proximity1*enpres;
(6 missing values generated)

. *     ****************************************************************  *;
. *       Need to drop elections that use a fused vote in legislative     *;
. *       and presidential elections.                                     *;
. *       Drop Bolivia, Uruguay, Honduras up to and including the 1993    *;
. *       elections, Guatemala elections in 1990 (fused vote with         *;
. *       national district), Dominican Republic elections in 1966, 1970, *;
. *       1974 and 1986.                                                  *;
. *     ****************************************************************  *;
. drop if countrynumber==67;
(6 observations deleted)

. drop if countrynumber==76;
(10 observations deleted)

. drop if countrynumber==59 & year==1957;
(1 observation deleted)

. drop if countrynumber==59 & year==1971;
(1 observation deleted)

. drop if countrynumber==59 & year==1985;
(1 observation deleted)

. drop if countrynumber==59 & year==1989;
(1 observation deleted)

. drop if countrynumber==59 & year==1993;
(1 observation deleted)

. drop if countrynumber==57 & year==1990;
(1 observation deleted)

. drop if countrynumber==54 & year==1966;
(1 observation deleted)

. drop if countrynumber==54 & year==1970;
(1 observation deleted)

. drop if countrynumber==54 & year==1974;
(1 observation deleted)

. drop if countrynumber==54 & year==1986;
(1 observation deleted)

. *     ****************************************************************  *;
. *       Drop those countries where enep1 others are greater than 15% of *;
. *       the vote or seats.                                              *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       795    98.37987    37.49907          3        199
        year |       795    1978.405    16.17628       1946       2000
 institution |       795    1.677987    .8761928          1          3
     legelec |       795           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       795    .1924528    .3944749          0          1
      regime |       795    .0201258     .140519          0          1
  regime_leg |       795           0           0          0          0
    eighties |       795    .0779874    .2683206          0          1
    nineties |       795    .1320755    .3387859          0          1
-------------+--------------------------------------------------------
         old |       795    .8691824    .3374131          0          1
      avemag |       780    10.67815    26.32788          1        150
   districts |       781    99.17414    145.3965          1        659
        eneg |       668    1.885193    1.181399   1.004012   14.22434
        enep |       756    3.901045    1.872577       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       755     3.25645    7.698141          0       69.3
       enep1 |       755    4.307722    3.878852       1.23      57.56
        enpp |       782    3.248376    1.483183          1      10.87
 enpp_others |       772    1.487176    4.832215          0       54.1
       enpp1 |       771    3.336381    1.774226          1      20.94
-------------+--------------------------------------------------------
      enpres |       790    1.150055    1.589989          0       6.57
      medmag |       643    12.05365    28.96131          1        150
      newdem |       795    .1484277    .3557472          0          1
  proximity1 |       795    .2679623    .4011204          0          1
  proximity2 |       795     .191195    .3934898          0          1
-------------+--------------------------------------------------------
       seats |       788    213.4581    165.6253         11        672
  upperseats |       752    16.04122    47.66664          0        344
   uppertier |       752    5.992061    12.95682          0      77.95
twoelections |       795    .0226415    .1488514          0          1
twoelectio~1 |       795    .0113208    .1058617          0          1
-------------+--------------------------------------------------------
pres_plura~y |       795    .0716981    .2581498          0          1
 pres_runoff |       795     .208805    .4067107          0          1
pres_major~y |       795    .0566038    .2312294          0          1
pres_qualm~y |       795    .0352201    .1844518          0          1
    pres_stv |       795    .0037736    .0613521          0          1
-------------+--------------------------------------------------------
pres_college |       795    .0251572    .1567011          0          1
      logmag |       780    1.300769    1.266935          0   5.010635
uppertier_~g |       626    8.788684     28.8885          0   415.1962
 logmag_eneg |       653    2.353421    2.800488          0   25.75041
proximity1~s |       790    .7497948    1.240595          0       6.57

. drop if enep_others>15 & enep_others<100;
(29 observations deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       766    98.18016    36.94863          3        199
        year |       766    1978.255      16.153       1946       2000
 institution |       766    1.673629    .8725347          1          3
     legelec |       766           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       766    .1906005    .3930313          0          1
      regime |       766    .0182768     .134038          0          1
  regime_leg |       766           0           0          0          0
    eighties |       766    .0770235    .2668029          0          1
    nineties |       766    .1292428    .3356877          0          1
-------------+--------------------------------------------------------
         old |       766    .8733681    .3327774          0          1
      avemag |       753    11.00697    26.73715          1        150
   districts |       754    96.58621    144.5025          1        659
        eneg |       648    1.851634    1.155399   1.004012   14.22434
        enep |       727     3.90304    1.892247       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       726    1.972989    2.764791          0       14.7
       enep1 |       726    3.926618    1.928414       1.23      17.37
        enpp |       756    3.227698    1.477574          1      10.87
 enpp_others |       746    .9427614    2.950201          0       33.3
       enpp1 |       745    3.250604    1.520486          1       11.7
-------------+--------------------------------------------------------
      enpres |       761    1.142673    1.588175          0       6.57
      medmag |       617    12.49514    29.48294          1        150
      newdem |       766    .1409922    .3482409          0          1
  proximity1 |       766    .2662272    .4001552          0          1
  proximity2 |       766     .189295    .3919988          0          1
-------------+--------------------------------------------------------
       seats |       761    212.7766    165.2849         11        672
  upperseats |       723    15.30152     45.9748          0        344
   uppertier |       723     5.82888    12.72061          0      77.95
twoelections |       766    .0234987      .15158          0          1
twoelectio~1 |       766    .0117493    .1078261          0          1
-------------+--------------------------------------------------------
pres_plura~y |       766    .0704961    .2561485          0          1
 pres_runoff |       766    .2062663    .4048883          0          1
pres_major~y |       766    .0535248    .2252246          0          1
pres_qualm~y |       766    .0365535    .1877855          0          1
    pres_stv |       766    .0039164    .0624997          0          1
-------------+--------------------------------------------------------
pres_college |       766    .0261097    .1595656          0          1
      logmag |       753    1.338438    1.269949          0   5.010635
uppertier_~g |       606    8.565726    28.78322          0   415.1962
 logmag_eneg |       635    2.395093    2.817668          0   25.75041
proximity1~s |       761    .7427174    1.233463          0       6.57

. *     ****************************************************************  *;
. *       This drops 29 elections.  However, only 18 of these have        *;
. *       complete data on all of the variables.  There would have been   *;
. *       621 observations in the pooled model, but now there are only    *;
. *       603. Thus, I am dropping 2.9% of the sample.                    *;
. *     ****************************************************************  *;
.              *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *               So, now let's run stuff                                 *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                               1980s                                   *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. regress enep1  proximity1 enpres proximity1_enpres logmag  eneg logmag_eneg if eighties==1, robust;

Regression with robust standard errors                 Number of obs =      40
                                                       F(  6,    33) =    5.24
                                                       Prob > F      =  0.0007
                                                       R-squared     =  0.5085
                                                       Root MSE      =  1.4682

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -2.801177   1.015846    -2.76   0.009    -4.867931   -.7344228
      enpres |   1.194238   .3090146     3.86   0.000     .5655433    1.822933
proximity1~s |  -.5833484   .4788877    -1.22   0.232    -1.557653     .390956
      logmag |  -.3361184   .3250004    -1.03   0.309    -.9973367    .3250998
        eneg |  -.0492941    .050501    -0.98   0.336    -.1520392    .0534511
 logmag_eneg |   .4050611   .2157685     1.88   0.069    -.0339233    .8440455
       _cons |    3.32176   .4716557     7.04   0.000     2.362169     4.28135
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                               1990s                                   *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. regress enep1  proximity1 enpres proximity1_enpres logmag  eneg logmag_eneg if nineties==1, robust;

Regression with robust standard errors                 Number of obs =      72
                                                       F(  6,    65) =    8.66
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2498
                                                       Root MSE      =  2.1542

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -4.421141   .9966656    -4.44   0.000    -6.411619   -2.430662
      enpres |   .2019544   .2470995     0.82   0.417    -.2915374    .6954463
proximity1~s |   1.155136   .2998177     3.85   0.000     .5563585    1.753913
      logmag |   .6257657   .2512962     2.49   0.015     .1238924    1.127639
        eneg |   .0349117   .2318183     0.15   0.881    -.4280613    .4978848
 logmag_eneg |  -.1370639   .0845525    -1.62   0.110    -.3059269    .0317991
       _cons |   4.298143   .5834655     7.37   0.000     3.132882    5.463404
------------------------------------------------------------------------------

. regress enep1  proximity1 enpres proximity1_enpres logmag  eneg logmag_eneg if nineties==1 & old==1,
>  robust;

Regression with robust standard errors                 Number of obs =      42
                                                       F(  6,    35) =    8.41
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.4400
                                                       Root MSE      =  1.5307

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -5.096252   1.021942    -4.99   0.000    -7.170905   -3.021599
      enpres |   .0731976   .1424627     0.51   0.611     -.216017    .3624121
proximity1~s |   1.474441   .3057429     4.82   0.000     .8537498    2.095132
      logmag |    -.78447   .5763959    -1.36   0.182    -1.954616    .3856758
        eneg |  -.8655444   .5624706    -1.54   0.133     -2.00742    .2763316
 logmag_eneg |   .7965803   .3918196     2.03   0.050     .0011441    1.592016
       _cons |   5.232133   1.056907     4.95   0.000     3.086498    7.377769
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *        So, now let's look at pooled model                             *;
. *     ****************************************************************  *;
. regress enep1 proximity1 enpres proximity1_enpres eneg logmag logmag_eneg, robust cluster(country);

Regression with robust standard errors                 Number of obs =     603
                                                       F(  6,    83) =   12.90
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2477
Number of clusters (country) = 84                      Root MSE      =  1.6803

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -3.528578   .5423031    -6.51   0.000    -4.607197   -2.449959
      enpres |    .333224   .1727489     1.93   0.057    -.0103667    .6768147
proximity1~s |   .8363988   .2269382     3.69   0.000     .3850278     1.28777
        eneg |   .1303726   .1201759     1.08   0.281    -.1086525    .3693976
      logmag |   .4352943   .1935312     2.25   0.027     .0503686      .82022
 logmag_eneg |   .0022241   .1036316     0.02   0.983    -.2038949    .2083431
       _cons |   3.119327   .3284022     9.50   0.000     2.466148    3.772506
------------------------------------------------------------------------------

. regress enep1 proximity1 enpres proximity1_enpres eneg logmag logmag_eneg if old==1, robust cluster(
> country);

Regression with robust standard errors                 Number of obs =     528
                                                       F(  6,    50) =   17.32
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.3283
Number of clusters (country) = 51                      Root MSE      =  1.4613

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -3.442498   .4949233    -6.96   0.000     -4.43658   -2.448415
      enpres |   .2914018   .1664983     1.75   0.086    -.0430199    .6258235
proximity1~s |   .8186213   .2192167     3.73   0.000     .3783116    1.258931
        eneg |    .101851   .1405416     0.72   0.472    -.1804351    .3841371
      logmag |  -.0449729   .2380302    -0.19   0.851    -.5230707    .4331248
 logmag_eneg |    .345453   .1791566     1.93   0.060    -.0143936    .7052996
       _cons |   3.014188   .3312822     9.10   0.000     2.348788    3.679588
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *                               Afghanistan Example                     *;
. *     ****************************************************************  *;
. regress enep1 enpres proximity1 proximity1_enpres eneg logmag logmag_eneg if old==1, robust;

Regression with robust standard errors                 Number of obs =     528
                                                       F(  6,   521) =   46.54
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.3283
                                                       Root MSE      =  1.4613

------------------------------------------------------------------------------
             |               Robust
       enep1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      enpres |   .2914018   .0938902     3.10   0.002     .1069519    .4758517
  proximity1 |  -3.442498   .3266094   -10.54   0.000    -4.084131   -2.800865
proximity1~s |   .8186213    .164136     4.99   0.000     .4961715    1.141071
        eneg |    .101851   .0930213     1.09   0.274    -.0808919    .2845939
      logmag |  -.0449729   .1267911    -0.35   0.723    -.2940576    .2041117
 logmag_eneg |    .345453   .0881439     3.92   0.000     .1722918    .5186142
       _cons |   3.014188   .1930439    15.61   0.000     2.634948    3.393428
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar list b1 b3 varb1 varb3 covb1b3;
        b1 =  .29140181
        b3 =  .81862128
     varb1 =  .00881537
     varb3 =  .02694063
   covb1b3 =  -.0121202

. *     ****************************************************************  *;
. *       Shifting to plurality rule would reduce the effective number of *;
. *       presidential candidates by 1.7712361 - see pres_runoff.do       *;
. *     ****************************************************************  *;
. gen afghan= 1.7712361*(b1+b3*1);

. display afghan;
1.966113

. gen afghanse = 1.7712361*(sqrt(varb1+varb3*1^2+2*covb1b3*1));

. display afghanse;
.19007266

. gen afghanci_upper=afghan+ afghanse*1.96;

. display afghanci_upper;
2.3386555

. gen afghanci_lower=afghan-afghanse*1.96;

. display afghanci_lower;
1.5935706

. *     ****************************************************************  *;
. *       Thus, shifting to plurality rule would reduce the effective     *;
. *       number of electoral parties by 1.97 [1.59, 2.34].               *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                                   THE END                             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. exit;

end of do-file

.            log close
       log:  C:\DATA\electoral.log
  log type:  text
 closed on:  18 May 2005, 09:53:56
------------------------------------------------------------------------------------------------------
